package com.aki.ai_property.controller;

import com.aki.ai_property.dto.SignatureDto;
import com.aki.ai_property.entity.Signature;
import com.aki.ai_property.service.intf.SignatureService;
import com.aki.ai_property.vo.PageBean;
import com.aki.ai_property.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author:WuChuangChuang
 * Date:2022/8/27 16:51
 */
@RestController
@RequestMapping("/api/signature")
public class SignatureController {
    @Autowired
    private SignatureService service;

    /** 新增 */
    @PostMapping("/save.do")
    public Result save(Signature signature){
        return service.save(signature);
    }
    /** 修改 */
    @PostMapping("/update.do")
    public Result update(SignatureDto signatureDto){
        return service.update(signatureDto);
    }

    /** 删除 */
    @PostMapping("/delete.do")
    public Result delete(int id){
        return service.delete(id);
    }
    /** 查询 */
    @GetMapping("/all.do")
    public PageBean all(String name,int page,int limit){
        return service.all(name, page, limit);
    }

    /**批量删除*/
    @PostMapping("delids.do")
    public Result dels(int[] ids){
        return service.delIds(ids);
    }
}
